package com.chixing.day12_date_factory.factory;
/*
    该类的作用 用来获得 Phone 对象
*/
public class PhoneFactory {
    public Phone getPhone(String  type){
        Phone phone = null;
        switch (type){
            case "huawei": phone = new Huawei();break;
            case "vivo": phone = new Vivo();break;
            case "oppo": phone = new Oppo();break;
            default:phone = null;
        }
        return phone;
    }
}
